package com.service.impl;

import com.bean.dangBean.Employee;
import com.bean.ShoppingCart;
import com.dao.ShoppingCartMapper;
import com.service.ShoppingCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("shoppingCartService")
public class ShoppingCartServiceImpl implements ShoppingCartService {
    @Autowired
    private ShoppingCartMapper shoppingCartMapper;
    @Override
    public int save(ShoppingCart shoppingCart) {
        return shoppingCartMapper.insert(shoppingCart);
    }

    @Override
    public int remove(ShoppingCart shoppingCart) {
        return shoppingCartMapper.delete(shoppingCart);
    }

    @Override
    public int modify(ShoppingCart shoppingCart) {
        return shoppingCartMapper.update(shoppingCart);
    }

    @Override
    public List<ShoppingCart> find(ShoppingCart shoppingCart) {
        return shoppingCartMapper.select(shoppingCart);
    }

    @Override
    public int count(Map<String, Object> map) {
        return shoppingCartMapper.selectCount(map);
    }

    @Override
    public List<ShoppingCart> query(Map<String, Object> map) {
        return shoppingCartMapper.selectByPage(map);
    }
}
